$(document).ready(function (){
	
    // Using custom configuration
    $(window).bind('resize orientationchange', function(){
        
    });

var ww = $( document ).width();
var he =$('.item-image-wrap').width();
$('.item-image-wrap img').css('width',+he);
$('.view-item').css('width',+he);

//$(window).resize(function() {
        var wi = $(window).width();
        //$("p.testp").text('Screen width is currently: ' + wi + 'px.');
        if (wi <= 480){
			$('.foo1').trigger('destroy');
			//alert('fff'+wi);
		}
		else if (wi > 768 ){
			$(".foo1").carouFredSel({
				width: 1600,
				height: "100%",
				left: 0,
				responsive: true,
				overflow: 'visible',
				prev: { key: "left" },
				next: { key: "right" },
				auto: false,
				mousewheel: true,
				swipe: {
				onMouse: true,
				onTouch: true
			},
			scroll: {
				items: 1,
				duration: 1000,
				pauseOnHover: true
			},
			items: {
				visible: {
					min: 4
				}
			}
			});
		}
/*});*/
$(window).resize(function() {
        var wi = $(window).width();
        //$("p.testp").text('Screen width is currently: ' + wi + 'px.');
        if (wi <= 480){
			$('.foo1').trigger('destroy');
			//alert('fff'+wi);
		}

		else if (wi > 768 ){
			$(".foo1").carouFredSel({
				width: 1600,
				height: "100%",
				left: 0,
				responsive: true,
				overflow: 'visible',
				prev: { key: "left" },
				next: { key: "right" },
				auto: false,
				mousewheel: true,
				swipe: {
				onMouse: true,
				onTouch: true
			},
			scroll: {
				items: 1,
				duration: 1000,
				pauseOnHover: true
			},
			items: {
				visible: {
					min: 4
				}
			}
			});
		}
});
/*
		if (ww < 768) {
			$('.foo1').trigger('destroy');
		}
		if (ww > 768){
			
			$(".foo1").carouFredSel({
				width: 1600,
				height: "100%",
				left: 0,
				responsive: true,
				overflow: 'visible',
				prev: { key: "left" },
				next: { key: "right" },
				auto: false,
				mousewheel: true,
				swipe: {
				onMouse: true,
				onTouch: true
			},
			scroll: {
				items: 1,
				duration: 1000,
				pauseOnHover: true
			},
			items: {
				visible: {
					min: 4
				}
			}
			});
			pfHeight = 652;
	wHeight = null;
	wHeight = $(window).height();
	$( window ).resize(function(){
	if(wHeight != $(window).height()){
		wHeight = $(window).height();

		clearTimeout(sid);
		sid = setTimeout(function(){
				$(document.body).css('font-size', wHeight / pfHeight * 100 + '%');
			}, 50);
		}
	});
	$(document.body).css('font-size', wHeight / pfHeight * 100 + '%');
		} else{
			
			$('.search').click(function(){$('.search_wrap').show(); $('.back').show();});
			$('.back').click(function(){$('.search_wrap').hide(); $('.back').hide();});
		}

return false;
*/
});